package com.haoniu.web.controller.module;

import com.haoniu.framework.web.page.TableDataInfo;
import com.haoniu.module.domain.dto.UserPingtaiMoneyDTO;
import com.haoniu.module.service.UserPingtaiMoneyService;
import com.haoniu.module.service.UserService;
import com.haoniu.web.core.base.BaseController;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/module/userMoneyAward")
public class UserMoneyAwardController extends BaseController {

    private String prefix = "module/userMoneyAward";

    @Autowired
    private UserService userService;
    @Autowired
    private UserPingtaiMoneyService userPingtaiMoneyService;

    @RequiresPermissions("module:userMoneyAward:view")
    @GetMapping()
    public String RedPacketNumberDTO() {
        return prefix + "/userMoneyAward";
    }

    //平台一天 代理获取的推广收益详情
    @RequiresPermissions("module:userMoneyAward:award")
    @PostMapping("/award")
    @ResponseBody
    public TableDataInfo findeveryRoomsMoneyTotal(){
        List<UserPingtaiMoneyDTO> userPingtaiMoneyDTOList = userPingtaiMoneyService.searchPlatformEarningsToday();
        return  getDataTable(userPingtaiMoneyDTOList);
    }


}
